---
title: The middleware returned something that is not a Response object.
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> **MiddlewareNotAResponse**: Any data returned from middleware must be a valid `Response` object.

## 무엇이 잘못되었나요?

미들웨어가 `Response` 객체가 아닌 것을 반환할 때 개발 모드에서 발생합니다.

예시:
```ts
import {defineMiddleware} from "astro:middleware";
export const onRequest = defineMiddleware(() => {
  return "string"
});
```